import type { TimeSelectProps } from 'element-plus/es/components/time-select/src/time-select.d.ts'

type UseElTimeSelectProps<
  D extends Record<string, any>,
  P extends keyof Readonly<D>
> = UseFormItemProps<TimeSelectProps, D, P>

/**
 * el-time-select
 * @param prop item.prop
 * @param label item.label
 * @param props item的其他属性
 * @returns form-item-data
 */
export function useElTimeSelect<
  T extends Record<string, any>,
  P extends keyof T
>(prop: P, label: string, props: UseElTimeSelectProps<T, P> = {}) {
  return {
    prop,
    label,
    ...props,
    component: 'el-time-select'
  }
}
